import os
import utilities.Environment
from third_party.path import path

# assign some vars
debuglvl = utilities.Environment.debuglvl

root = path(os.getcwd())
logpath = root / "logs"
logfile = logpath / "temp_log.log"
if not logpath.exists():
    logpath.mkdir(1)

logfile.touch()


def log(lvl, message):
    if not debuglvl:
        # no debuglbvl means we a PRE load...
        print message
    elif lvl <= debuglvl:
        print message
    logfile.write_lines([message,],append=True)
    